
        Xope 2.01 .
        -----------

 A program that uses Xope should be built like this:      
  
***********************************************************************  
 
 startup:
 
 	lea	parameters,a0
 	jsr	polygon_mupp
 
* 	Register D0 contains the amount of memory used by Xope.
 
 	move.l	a0,variables	
	move.l	a1,jump
	move.l	a2,jump3
	move.l	a3,jump4

	rts
	
********	
	
main:
	move.l	variables,a0
	
	*
	*		; Send cordinates and commands to Xope.
	*
	
	move.l	jump,a1	; or jump3 / jump4 depending on funktion.
	jsr	(a1)	; jump to polygon routine.
	
	rts
	
********
	
variables:	dc.l	0
jump:		dc.l	0
jump3:		dc.l	0
jump4:		dc.l	0
screen:		dc.l	scrbuf
	
parameters:
	dc.w	0		; computerpointer
	dc.l	buffert		; pointer to buffert
	dc.l	screen		; pointer to screen pointer
	dc.w	0,0,-1000		; lower x,y,z cut
	dc.w	319,199,1000	; higher x,y,z cut
	
polygon_mupp:
	incbin	"a:\bin\xope2_01.img" ; self-relokable polygone routine.
	section bss
	ds.l	4096		; MUST BE AFTER XOPE		

	
buffert:	ds.l	131*256		; At least 131K if STE,
				; 84K if TT

scrbuf:				; This is the picture buffer.



******************************************************************* 	        

The computer pointer states what kind of polygon routine that is wanted.
If you wants a STE dependent routine, or TT routine.
If the pointer is set to two, then the program is forced to a TT mode.
And if a one is stated, then the STE routine is used instead.
A zero to the computer pointer will make the program make it's own
choise, and blitter has the priority.

"Jump" is the address for a general polygon routine, that can draw
any polygon from three to sixten edges and it cuts the polygon at
the borders.
"Jump3" and "Jump4", is two special routines that draws triangles respective
squares. And they don't cut the polygons by the borders. This increses
speed. 
 
Variables is the address that you will send the datablock that is needed
for each polygon. This block is built like this:


pocom:	dc.w	0
color:	dc.w	0
data:	ds.l	100



"pocom" is built like this:
  
   bit 0:	Should the backside of the polygone be visible?
   bit 1:	Should the frontside of the polygone be visible?
   bits 2-3: Number of bitplanes. 0=1, 1=2, 2= 4 , 3=reserved
   bit 4:	Reserved for the future.
   bit 5:	Is border cut wanted?
   bit 6:	Is z cut wanted? 
   bit 7:	Reserved for the future.
   bits 8-15: Number of polygon edges-1.

   If a polygone with four edges, and front and backside visibility
   and border cut is wanted, then pocom should be $303
   

"color" is built like this:
  
   bits 0-7:	Reserved for maskconfiguration ( planed ).

  In four bitplanes:

   bits 8-11:	Color number 0-15.

  In two bitplanes:

   bits 8-9:	Color number 0-3.
   bits 12-13:	Bitplane offset 0-2.

  In one bitplane:
  
   bits 8-9:	Bitplane offset 0-3.
   bit  15:	0= OR polygon, 1= AND polygon..
     
"data" is the place the cordinates should be placed. The cordinates
must be in a certain order, it must be in clockwise or opposite.
If not, the routine will probably crash.
If the z cut has been chosed, then the cordinates will be in x,y,z order.
And if z cut is off, there is only need for x,y.



     Micael Hildenborg.
     Kalenderv. 6
     415 11 Gothenburg
     Sweden
     
     